<?php 
use app\modules\cruise\models\Customer;
?>
	<h4 class="page-header">
	 	团队签到统计
	</h4>
	<div class="total-p">
		<table class="table table-bordered" style="font-size:12px;">
		 <thead>
            <tr><th>团号</th><th>各团共计人数</th><th>已签到人数</th><th>未签到人数</th><th>已取消人数</th></tr>
        </thead>
        <tbody>  
		<tr>
		<?php if($group_arr){ ?>
        		<?php foreach($group_arr as $g){ ?>
        				 <?php 
        				 	$num_s = Customer::find()->where(['status'=>1,'group'=>$g])->count();
        				 	$group_num = ['sign'=>0,'un_sign'=>0,'cancel'=>0];
        					$group = Customer::find()->where(['status'=>1,'group'=>$g])->all();
					        if($group){
					            foreach($group as $gp){
					                if($gp->cancel < 3 && $gp->sign == 1){
					                    $group_num['sign'] += 1;
					                }else if($gp->cancel < 3 && $gp->sign == 0){
					                    $group_num['un_sign'] += 1;
					                }else if($gp->cancel == 3){
					                    $group_num['cancel'] += 1;
					                }
					                
					            }
					        }
        				 ?>
        			<tr>
        				<td><span style="color: red;"><?=$g?></span></td>
						<td><span style="color: red;"><?=$num_s?></span></td>
						<td><span style="color: red;"><?=$group_num['sign']?></span></td>
						<td><span style="color: red;"><?=$group_num['un_sign']?></span></td>
						<td><span style="color: red;"><?=$group_num['cancel']?></span></td>
        			</tr>
        		<?php }?>
        <?php }?>
		</tr>
		 </tbody> 
		</table>
	</div>	
